import Vue from 'vue'

const axios = Vue.$axios

export const LoginUser = (data) => {
    // console.log(data);
    return axios({
        url: '/login',
        method: 'post',
        data: data,
    })
}


export const GetListUser = () => {
    return axios({
        url: '/users',
        method: 'get',
    })
}

export const GetOneUser = (id) => {
    return axios({
        url: '/users/' + id,
        method: 'get'
    })
}

export const CreateOneUser = (data) => {
    return axios({
        url: '/users',
        method: 'post',
        data: data
    })
}

export const UpdateOneUser = (data) => {
    return axios({
        url: '/users' + "/" + data.id,
        method: 'put',
        data: data
    })
}

export const PatchOneUser = (id, data) => {
    return axios({
        url: '/users' + '/' + id,
        method: 'patch',
        data: data
    })
}

export const RemoveOneUser = (id) => {
    return axios({
        url: '/users/' + id,
        method: 'delete',
    })
}